.container {
    padding: 16px;
}

.configCard,
.previewCard {
    height: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
     :global(.ant-card-head) {
        border-bottom: 1px solid #333;
        padding: 0 24px;
    }
     :global(.ant-card-body) {
        padding: 24px;
    }
}

.imagePreview {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    .loadingContainer {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 500px;
        background-color: #1a1a1a;
        border-radius: 8px;
        color: #a0a0a0;
        .loadingSpinner {
            width: 60px;
            height: 60px;
            border: 4px solid #333;
            border-top: 4px solid #00ff00;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
            box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
        }
        p {
            font-size: 16px;
            color: #a0a0a0;
            margin: 0;
            text-align: center;
            animation: pulse 2s ease-in-out infinite;
        }
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.generatedImage {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.placeholderImage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 500px;
    background-color: #1a1a1a;
    border-radius: 8px;
    color: #a0a0a0;
    img {
        transition: all 0.3s ease;
        margin-bottom: 16px;
        &:hover {
            opacity: 0.8 !important;
            filter: brightness(1) !important;
            transform: scale(1.05);
        }
    }
    p {
        font-size: 16px;
        margin-top: 16px;
        color: #a0a0a0;
    }
}

.presetButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    button {
        flex-grow: 0;
        background-color: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
        &:hover {
            background-color: #333;
            border-color: #555;
            color: #fff;
        }
    }
}

.imageInfo {
    margin-top: 24px;
     :global(.ant-divider) {
        margin: 16px 0;
        border-color: #333;
    }
    strong {
        color: #e0e0e0;
    }
}

// 预览卡片按钮样式美化
.previewCard {
     :global(.ant-card-extra) {
        .ant-btn {
            background: #2a2a2a;
            border-color: #444;
            color: #e0e0e0;
            transition: all 0.3s ease;
            &:hover:not(:disabled) {
                background: #00ff00;
                border-color: #00ff00;
                color: #000000;
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
            }
            &:disabled {
                background: #1a1a1a;
                border-color: #333;
                color: #666;
                cursor: not-allowed;
            }
            // 下载按钮特殊样式
            &:has(.anticon-download) {
                &:hover:not(:disabled) {
                    background: linear-gradient(135deg, #00ff00, #00cc00);
                    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.4);
                }
            }
            // 重新生成按钮特殊样式
            &:has(.anticon-reload) {
                &:hover:not(:disabled) {
                    background: linear-gradient(135deg, #ff6b35, #f7931e);
                    border-color: #ff6b35;
                    color: #ffffff;
                    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
                }
            }
            // 复制按钮特殊样式
            &:has(.anticon-copy) {
                &:hover:not(:disabled) {
                    background: linear-gradient(135deg, #4a90e2, #357abd);
                    border-color: #4a90e2;
                    color: #ffffff;
                    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
                }
            }
        }
    }
}


/* 图片上传相关样式 */

.uploadSection {
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border-radius: 16px;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, #00ff00, #00cc00, #00ff00);
        animation: borderGlow 3s ease-in-out infinite;
        z-index: 1;
    }
    // 确保上传组件没有额外的边框
     :global(.ant-upload-wrapper) {
        border: none !important;
        background: transparent !important;
    }
     :global(.ant-upload-list) {
        border: none !important;
        background: transparent !important;
    }
}

@keyframes borderGlow {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.uploadTitle {
    margin-bottom: 16px;
    color: #00ff00;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 255, 0, 0.3);
}

.dragger {
    border-radius: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
    border: 2px dashed #00ff00 !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
    margin-top: 2px; // 为顶部发光边框留出空间
    box-sizing: border-box !important;
    // 确保没有额外的边框
     :global(.ant-upload) {
        border: none !important;
        background: transparent !important;
    }
     :global(.ant-upload-drag) {
        border: none !important;
        background: transparent !important;
    }
     :global(.ant-upload-btn) {
        border: none !important;
        background: transparent !important;
    }
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
        transition: left 0.6s ease;
        z-index: 0;
    }
    &:hover {
        border-color: #00cc00 !important;
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%) !important;
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 255, 0, 0.2);
        &::before {
            left: 100%;
        }
         :global(.ant-upload-drag-icon) {
            .anticon {
                color: #00ff00 !important;
                transform: scale(1.1);
            }
        }
         :global(.ant-upload-drag-icon .anticon svg) {
            fill: #00ff00 !important;
        }
         :global(.ant-upload-text) {
            color: #00ff00 !important;
        }
    }
     :global(.ant-upload-drag-icon) {
        margin-bottom: 16px;
        .anticon {
            color: #00cc00 !important;
            font-size: 56px;
            transition: all 0.3s ease;
            filter: drop-shadow(0 4px 8px rgba(0, 255, 0, 0.3));
        }
    }
     :global(.ant-upload-text) {
        margin: 0 0 8px;
        color: #e0e0e0 !important;
        font-size: 18px;
        font-weight: 600;
        transition: all 0.3s ease;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
     :global(.ant-upload-hint) {
        color: #a0a0a0 !important;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    // 拖拽状态
    &:global(.ant-upload-drag-hover) {
        border-color: #00ff00 !important;
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%) !important;
        box-shadow: 0 12px 32px rgba(0, 255, 0, 0.3);
        transform: translateY(-4px);
         :global(.ant-upload-drag-icon) {
            .anticon {
                color: #00ff00 !important;
                transform: scale(1.2);
                animation: uploadPulse 1s infinite;
            }
        }
         :global(.ant-upload-drag-icon .anticon svg) {
            fill: #00ff00 !important;
        }
         :global(.ant-upload-text) {
            color: #00ff00 !important;
            font-weight: 700;
        }
         :global(.ant-upload-hint) {
            color: #00cc00 !important;
        }
    }
    // 强制覆盖图标颜色
     :global(.ant-upload-drag-icon .anticon) {
        color: #00cc00 !important;
    }
     :global(.ant-upload-drag-icon .anticon svg) {
        fill: #00cc00 !important;
    }
}

// 上传图标脉冲动画
@keyframes uploadPulse {
    0%,
    100% {
        transform: scale(1.2);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

.uploadedImage {
    width: 100%;
    .imageWrapper {
        position: relative;
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        border: 2px solid #333;
        transition: all 0.3s ease;
        &:hover {
            border-color: #00ff00;
            box-shadow: 0 8px 24px rgba(0, 255, 0, 0.2);
            transform: translateY(-2px);
        }
        img {
            display: block;
            width: 100%;
            max-height: 300px;
            object-fit: contain;
            border-radius: 10px;
            background-color: #1a1a1a;
            transition: all 0.3s ease;
        }
        .deleteButton {
            position: absolute;
            bottom: 16px;
            right: 16px;
            background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(42, 42, 42, 0.9) 100%);
            border-radius: 8px;
            color: #e0e0e0;
            border: 1px solid #444;
            padding: 8px 16px;
            font-weight: 500;
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            &:hover {
                background: linear-gradient(135deg, rgba(42, 42, 42, 0.95) 0%, rgba(58, 58, 58, 0.95) 100%);
                color: #00ff00;
                border-color: #00ff00;
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
            }
             :global(.anticon) {
                margin-right: 6px;
                font-size: 14px;
            }
        }
    }
}


/* 风格选择卡片样式 */

.styleSection {
    margin-bottom: 32px;
    .styleTitle {
        font-size: 16px;
        font-weight: 600;
        color: #ffffff;
        margin-bottom: 16px;
        padding-bottom: 8px;
        border-bottom: 1px solid #333;
    }
    .styleCards {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }
    .styleCard {
        background: #1a1a1a;
        border: 2px solid #333;
        border-radius: 12px;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        min-width: 0; // 防止卡片溢出
        &:hover {
            border-color: #555;
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }
        &.selected {
            border-color: #00ff00;
            box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
            .styleImage {
                .selectedOverlay {
                    opacity: 1;
                }
            }
        }
        .styleImage {
            position: relative;
            width: 100%;
            height: 100px;
            overflow: hidden;
            .image {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: transform 0.3s ease;
                border-radius: 8px 8px 0 0;
            }
            &:hover .image {
                transform: scale(1.05);
            }
            .selectedOverlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 255, 0, 0.2);
                display: flex;
                align-items: center;
                justify-content: center;
                opacity: 0;
                transition: opacity 0.3s ease;
                .checkmark {
                    background: #00ff00;
                    color: #000000;
                    width: 28px;
                    height: 28px;
                    border-radius: 50%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    font-weight: bold;
                    font-size: 14px;
                    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.3);
                }
            }
        }
        .styleInfo {
            padding: 8px;
            .styleName {
                font-size: 12px;
                font-weight: 600;
                color: #ffffff;
                margin-bottom: 2px;
                line-height: 1.2;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }
            .styleDescription {
                font-size: 10px;
                color: #cccccc;
                line-height: 1.3;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
            }
        }
    }
}


/* 酷炫的生成按钮样式 */

.generateButton {
    height: 56px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%) !important;
    border: none !important;
    color: #000000 !important;
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }
    &:hover {
        background: linear-gradient(135deg, #00cc00 0%, #009900 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 12px rgba(0, 255, 0, 0.4), 0 12px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
        &::before {
            left: 100%;
        }
    }
    &:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    &:disabled {
        background: linear-gradient(135deg, #444 0%, #333 100%) !important;
        color: #666 !important;
        transform: none !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        cursor: not-allowed !important;
        &::before {
            display: none;
        }
    }
    // 加载状态
    &.ant-btn-loading {
        background: linear-gradient(135deg, #00cc00 0%, #009900 100%) !important;
        color: #000000 !important;
        .ant-btn-loading-icon {
            color: #000000 !important;
        }
    }
    // 图标样式
     :global(.anticon) {
        font-size: 20px !important;
        margin-right: 8px !important;
        animation: rocketPulse 2s infinite;
    }
    // 文字样式
    span {
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
    }
}

// 火箭图标脉冲动画
@keyframes rocketPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

// 生成中状态的动画
.generateButton:global(.ant-btn-loading) {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%) !important;
    animation: generatingPulse 1.5s infinite;
}

@keyframes generatingPulse {
    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 255, 0, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 255, 0, 0.8);
    }
}

// 响应式设计
@media (max-width: 1200px) {
    .styleSection {
        .styleCards {
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
    }
}

@media (max-width: 768px) {
    .styleSection {
        .styleCards {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        .styleCard {
            .styleImage {
                height: 80px;
            }
            .styleInfo {
                padding: 6px;
                .styleName {
                    font-size: 11px;
                }
                .styleDescription {
                    font-size: 9px;
                }
            }
        }
    }
    .generateButton {
        height: 48px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .styleSection {
        .styleCards {
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }
        .styleCard {
            .styleImage {
                height: 70px;
            }
            .styleInfo {
                padding: 4px;
                .styleName {
                    font-size: 10px;
                }
                .styleDescription {
                    font-size: 8px;
                }
            }
        }
    }
    .generateButton {
        height: 44px !important;
        font-size: 15px !important;
    }
}

// 滑动组件主题配色
:global(.ant-slider) {
    // 轨道样式
    .ant-slider-rail {
        background-color: #333 !important;
        border-radius: 4px !important;
    }
    // 已选择轨道样式
    .ant-slider-track {
        background: linear-gradient(90deg, #00ff00, #00cc00) !important;
        border-radius: 4px !important;
        box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3) !important;
    }
    // 滑块样式
    .ant-slider-handle {
        background: linear-gradient(135deg, #00ff00, #00cc00) !important;
        border: 2px solid #00ff00 !important;
        box-shadow: 0 4px 8px rgba(0, 255, 0, 0.4), 0 0 0 2px rgba(0, 255, 0, 0.2) !important;
        transition: all 0.3s ease !important;
        // 隐藏多余的::before伪元素
        &::before {
            display: none !important;
        }
        // 隐藏多余的::after伪元素
        &::after {
            display: none !important;
        }
        &:hover {
            background: linear-gradient(135deg, #00cc00, #009900) !important;
            border-color: #00cc00 !important;
            transform: translateX(-50%) scale(1.2) !important;
            box-shadow: 0 6px 12px rgba(0, 255, 0, 0.6), 0 0 0 3px rgba(0, 255, 0, 0.3) !important;
        }
        &:focus {
            background: linear-gradient(135deg, #00cc00, #009900) !important;
            border-color: #00cc00 !important;
            box-shadow: 0 6px 12px rgba(0, 255, 0, 0.6), 0 0 0 3px rgba(0, 255, 0, 0.3) !important;
        }
        &:active {
            background: linear-gradient(135deg, #009900, #006600) !important;
            border-color: #009900 !important;
            transform: translateX(-50%) scale(1.1) !important;
        }
    }
    // 步进点样式 - 隐藏所有步进点
    .ant-slider-step {
        display: none !important;
        .ant-slider-dot {
            display: none !important;
            &.ant-slider-dot-active {
                display: none !important;
            }
        }
    }
    // 标记样式
    .ant-slider-mark {
        .ant-slider-mark-text {
            color: #ccc !important;
            font-size: 12px !important;
            transition: all 0.3s ease !important;
            &.ant-slider-mark-text-active {
                color: #00ff00 !important;
                font-weight: 600 !important;
                text-shadow: 0 1px 2px rgba(0, 255, 0, 0.3) !important;
            }
        }
    }
    // 悬停状态
    &:hover {
        .ant-slider-rail {
            background-color: #444 !important;
        }
        .ant-slider-track {
            background: linear-gradient(90deg, #00cc00, #009900) !important;
            box-shadow: 0 3px 6px rgba(0, 255, 0, 0.4) !important;
        }
    }
    // 禁用状态
    &.ant-slider-disabled {
        .ant-slider-rail {
            background-color: #222 !important;
        }
        .ant-slider-track {
            background: linear-gradient(90deg, #555, #444) !important;
            box-shadow: none !important;
        }
        .ant-slider-handle {
            background: linear-gradient(135deg, #555, #444) !important;
            border-color: #666 !important;
            box-shadow: none !important;
            cursor: not-allowed !important;
            &:hover {
                transform: translateX(-50%) scale(1) !important;
                box-shadow: none !important;
            }
        }
        .ant-slider-step {
            display: none !important;
            .ant-slider-dot {
                display: none !important;
                &.ant-slider-dot-active {
                    display: none !important;
                }
            }
        }
    }
}

// 滑块标签样式美化
.container {
     :global(.ant-form-item-label) {
        label {
            color: #e0e0e0 !important;
            font-weight: 500 !important;
            font-size: 14px !important;
            transition: all 0.3s ease !important;
            &:hover {
                color: #00ff00 !important;
                text-shadow: 0 1px 2px rgba(0, 255, 0, 0.3) !important;
            }
        }
    }
    // 滑块容器样式
     :global(.ant-form-item) {
        margin-bottom: 24px !important;
        // 滑块标签特殊样式
        &:has(.ant-slider) {
             :global(.ant-form-item-label) {
                label {
                    color: #00ff00 !important;
                    font-weight: 600 !important;
                    font-size: 15px !important;
                    text-shadow: 0 1px 2px rgba(0, 255, 0, 0.3) !important;
                    letter-spacing: 0.5px !important;
                    &:hover {
                        color: #00cc00 !important;
                        text-shadow: 0 2px 4px rgba(0, 255, 0, 0.4) !important;
                    }
                }
            }
            // 滑块值显示样式
             :global(.ant-form-item-control) {
                 :global(.ant-slider) {
                    margin-top: 8px !important;
                    // 滑块值标签
                     :global(.ant-slider-mark-text) {
                        color: #a0a0a0 !important;
                        font-size: 11px !important;
                        font-weight: 400 !important;
                        transition: all 0.3s ease !important;
                        &.ant-slider-mark-text-active {
                            color: #00ff00 !important;
                            font-weight: 600 !important;
                            text-shadow: 0 1px 2px rgba(0, 255, 0, 0.3) !important;
                        }
                    }
                }
            }
        }
    }
    // 特殊滑块样式（去噪强度、采样步数、CFG Scale）
     :global(.ant-form-item:has(.ant-slider)) {
         :global(.ant-form-item-label) {
            label {
                position: relative !important;
                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: 50%;
                    transform: translateY(-50%);
                    width: 3px;
                    height: 16px;
                    background: linear-gradient(135deg, #00ff00, #00cc00);
                    border-radius: 2px;
                    opacity: 0.8;
                    transition: all 0.3s ease;
                }
                &:hover::before {
                    opacity: 1;
                    box-shadow: 0 2px 4px rgba(0, 255, 0, 0.4);
                }
            }
        }
        // 滑块值显示增强
         :global(.ant-form-item-control) {
             :global(.ant-slider) {
                // 滑块轨道增强
                 :global(.ant-slider-rail) {
                    height: 6px !important;
                    background: linear-gradient(90deg, #222, #333) !important;
                    border-radius: 3px !important;
                }
                 :global(.ant-slider-track) {
                    height: 6px !important;
                    background: linear-gradient(90deg, #00ff00, #00cc00) !important;
                    border-radius: 3px !important;
                    box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
                }
                // 滑块手柄增强
                 :global(.ant-slider-handle) {
                    width: 20px !important;
                    height: 20px !important;
                    margin-top: -7px !important;
                    background: linear-gradient(135deg, #00ff00, #00cc00) !important;
                    border: 2px solid #00ff00 !important;
                    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.4), 0 0 0 2px rgba(0, 255, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
                    // 隐藏多余的伪元素
                    &::before {
                        display: none !important;
                    }
                    &::after {
                        display: none !important;
                    }
                    &:hover {
                        width: 24px !important;
                        height: 24px !important;
                        margin-top: -10px !important;
                        background: linear-gradient(135deg, #00cc00, #009900) !important;
                        border-color: #00cc00 !important;
                        box-shadow: 0 6px 12px rgba(0, 255, 0, 0.6), 0 0 0 3px rgba(0, 255, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
                    }
                }
            }
        }
    }
}